home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJDEV200.ZIP / include / dir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-24  |  2.8 KB  |  87 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_dir_h_
  3. #define __dj_include_dir_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #ifndef _POSIX_SOURCE
  14.  
  15. /* ffblk is also enhanced for LFNs; the dos 21 byte reserved area is used to
  16.    hold the extra information.  Fields marked LFN are only valid if the magic
  17.    is set to LFN32 */
  18.  
  19. struct ffblk {
  20.   char lfn_magic[6] __attribute__((packed));            /* LFN */
  21.   short lfn_handle __attribute__((packed));            /* LFN */
  22.   unsigned short lfn_ctime __attribute__((packed));        /* LFN */
  23.   unsigned short lfn_cdate __attribute__((packed));        /* LFN */
  24.   unsigned short lfn_atime __attribute__((packed));        /* LFN */
  25.   unsigned short lfn_adate __attribute__((packed));        /* LFN */
  26.   char _ff_reserved[5] __attribute__((packed));
  27.   unsigned char  ff_attrib __attribute__((packed));
  28.   unsigned short ff_ftime __attribute__((packed));
  29.   unsigned short ff_fdate __attribute__((packed));
  30.   unsigned long  ff_fsize __attribute__((packed));
  31.   char ff_name[260] __attribute__((packed));
  32. };
  33.  
  34. struct ffblklfn {
  35.   unsigned long      fd_attrib __attribute__((packed));
  36.   unsigned long long fd_ctime __attribute__((packed));
  37.   unsigned long long fd_atime __attribute__((packed));
  38.   unsigned long long fd_mtime __attribute__((packed));
  39.   unsigned long      fd_sizehi __attribute__((packed));
  40.   unsigned long      fd_size __attribute__((packed));
  41.   unsigned long long fd_reserved __attribute__((packed));
  42.   char               fd_longname[260] __attribute__((packed));
  43.   char               fd_name[14] __attribute__((packed));
  44. };
  45.  
  46. #define FA_RDONLY       1
  47. #define FA_HIDDEN       2
  48. #define FA_SYSTEM       4
  49. #define FA_LABEL        8
  50. #define FA_DIREC        16
  51. #define FA_ARCH         32
  52.  
  53. /* for fnmerge/fnsplit */
  54. #define MAXPATH   80
  55. #define MAXDRIVE  3
  56. #define MAXDIR      66
  57. #define MAXFILE   9
  58. #define MAXEXT      5
  59.  
  60. #define WILDCARDS 0x01
  61. #define EXTENSION 0x02
  62. #define FILENAME  0x04
  63. #define DIRECTORY 0x08
  64. #define DRIVE      0x10
  65.  
  66. int    __file_tree_walk(const char *_dir, int (*_fn)(const char *_path, const struct ffblk *_ff));
  67. int    findfirst(const char *_pathname, struct ffblk *_ffblk, int _attrib);
  68. int    findnext(struct ffblk *_ffblk);
  69. void    fnmerge (char *_path, const char *_drive, const char *_dir, const char *_name, const char *_ext);
  70. int    fnsplit (const char *_path, char *_drive, char *_dir, char *_name, char *_ext);
  71. int    getdisk(void);
  72. char *    searchpath(const char *_program);
  73. int    setdisk(int _drive);
  74.  
  75. #endif /* !_POSIX_SOURCE */
  76. #endif /* !__STRICT_ANSI__ */
  77. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  78.  
  79. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  80. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  81.  
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85.  
  86. #endif /* !__dj_include_dir.h_ */
  87.